package org.ljy.springblog.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.NonNull;
import org.ljy.springblog.utils.DateUtils;

import java.util.Date;

@Data
public class BlogInfo {
    private Integer id;
    @NotBlank(message = "title不能为null")
    private String title;
    @NotBlank(message = "content不能为null")
    private String content;
    private Integer userId;
    //当前作者是否为登陆用户状态
    private Boolean isLoginUser;

    private Integer deleteFlag;
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

//    public String getUpdateTime() {
//        return DateUtils.format(updateTime);
//    }
}
